package net.udp;

import java.net.DatagramPacket;
import java.net.DatagramSocket;

public class UDPDiscardServer
{
	public final static int DEFAULT_PORT = 9;
	public final static int MAX_PACKET_SIZE = 75507;
	public static void main(String[] args)
	{
		int port = DEFAULT_PORT;
		byte[] buffer = new byte[MAX_PACKET_SIZE];
		try
		{
			DatagramSocket server = new DatagramSocket(port);
			DatagramPacket packet = new DatagramPacket(buffer, buffer.length);
			while(true)
			{
				try
				{
					server.receive(packet);
					String s = new String(packet.getData(),0,packet.getLength(),"UTF-8");
					System.out.println(s);
					packet.setLength(buffer.length);
				}
				catch (Exception e)
				{
				}
			}
		}
		catch (Exception e)
		{
		}
	}
}
